package com.heima.media.controller;


import com.heima.common.dto.ResponseResult;
import com.heima.media.dto.LoginDto;
import com.heima.media.service.IWmUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author WSJ
 * @Date 2022-03-11-15:46
 * @Version 1.0 （版本号）
 */
@Api(tags = "自媒体平台登录API")
@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private IWmUserService wmUserService;

    @ApiOperation(value = "根据用户名密码登录",notes = "author:wsj")
    @ApiImplicitParam(name = "dto",value = "登录用户参数",required = true,dataType = "LoginDto")
    @PostMapping("/in")
    public ResponseResult login(@RequestBody LoginDto dto) {
        return wmUserService.login(dto);
    }

}
